// ProcTable.h : Stores procedure and their index and some other useful information.
// Author: Achyut P Balaji
//
#ifndef PROC_TABLE_H
#define PROC_TABLE_H

#include"SPA_Data_Types.h"

using namespace std;

typedef string PROC;
enum RANGE {RANGE_START,RANGE_END};

class ProcTable { 
private:
	vector<PROC> procedureList;
	vector<STATEMENT_INDEX> rangeStart;
	vector<STATEMENT_INDEX> rangeEnd;
	vector<STATEMENT_INDEX> tempRangeStart;
	vector<STATEMENT_INDEX> tempRangeEnd;
	static ProcTable *obj;
	ProcTable();
	bool initialised;
public:
	static ProcTable* getInstance();
	PROC_INDEX insertProc (PROC p);
	BOOLEAN insertProc(PROC_INDEX p,STATEMENT_INDEX index,RANGE range);
	PROC getProcName (PROC_INDEX ind);
	PROC_INDEX getProcIndex (PROC p);
	INTEGER getSize();
	STATEMENT_INDEX getRangeStart(PROC_INDEX ind);
	STATEMENT_INDEX getRangeEnd(PROC_INDEX ind);
	PROC_INDEX getProcIn(STATEMENT_INDEX n);
	void initialise();
};

#endif